package com.xcesys.extras.dataobject.system;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

import com.xcesys.extras.dataobject.TreeNode;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Resource")
public class Resource extends TreeNode<Resource> {

	private static final long serialVersionUID = -4756197942476199792L;

	public static final String F_DESCRIPTION = "description";
	public static final String F_PATH = "path";
	public static final String F_TYPE = "type";
	public static final String F_EDITABLE = "editable";

	private String description;

	private boolean editable;

	private String path;

	private String type;

	public Resource() {
	}

	public String getDescription() {
		return this.description;
	}

	public boolean getEditable() {
		return editable;
	}

	public String getPath() {
		return this.path;
	}

	public String getType() {
		return this.type;
	}

	public void setDescription(String resDesc) {
		this.description = resDesc;
	}

	public void setEditable(boolean editable) {
		this.editable = editable;
	}

	public void setPath(String resourcePath) {
		this.path = resourcePath;
	}

	public void setType(String resourceType) {
		this.type = resourceType;
	}

	/**
	 * Constructs a <code>String</code> with all attributes in name = value
	 * format.
	 * 
	 * @return a <code>String</code> representation of this object.
	 */
	@Override
	public String toString() {
		final String TAB = "    ";

		String retValue = "";

		retValue = "Resource ( " + this.getName() + TAB + "description = "
				+ this.description + TAB + "type = " + this.type + TAB
				+ "path = " + this.path + TAB + " )";

		return retValue;
	}

}
